//
//  LRMapViewController.m
//  本地生活圈
//
//  Created by admin on 15/8/16.
//  Copyright (c) 2015年 懒人. All rights reserved.
//

#import "LRMapViewController.h"

@interface LRMapViewController ()
/**
 *  mapView
 */
@property (nonatomic, strong) MKMapView *mapView;
/**
 *  barView
 */
@property (nonatomic, strong) UIView *bottomView;
@end

@implementation LRMapViewController

- (MKMapView *)mapView
{
    if (!_mapView)
    {
        _mapView = [[MKMapView alloc]initWithFrame:CGRectMake(0, kNavHeight, kUIScreenW, kUIScreenH)];
        [self.view addSubview:_mapView];
    }
    return _mapView;
}

- (UIView *)bottomView
{
    if (!_bottomView)
    {
        _bottomView = [[UIView alloc]initWithFrame:CGRectMake(0, kUIScreenH - kTabBarHeight, kUIScreenW, kTabBarHeight)];
        _bottomView.backgroundColor = [UIColor whiteColor];
        [self.view addSubview:_bottomView];
    }
    return _bottomView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    self.titleLabel.text = @"商家地图";
    
    UIImageView *imagView = [[UIImageView alloc]initWithFrame:CGRectMake(10, 20, 15, 15)];
    imagView.image = [UIImage imageNamed:@"home_location"];
    
    UILabel *adressLabel = [[UILabel alloc]initWithFrame:CGRectMake(35, 15, 250, 20)];
    adressLabel.text = self.adress;
    adressLabel.textColor = [UIColor greenColor];
    adressLabel.font = [UIFont systemFontOfSize:15];

    
    MKPointAnnotation *ann = [[MKPointAnnotation alloc]init];
    ann.coordinate = self.placeMark.location.coordinate;
    
    [self.mapView addAnnotation:ann];
    [self.mapView showAnnotations:@[ann] animated:YES];
    
    [self.bottomView addSubview:imagView];
    [self.bottomView addSubview:adressLabel];
}

- (void)backClick
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

@end
